package com.zxh.okretrofit.entity;

import com.google.gson.annotations.SerializedName;
import com.zxh.okretrofit.constant.HttpConfig;

/**
 * 列表的基础实体
 * Created by zhangxuehui on 2018/2/6.
 */
public class BaseEntity<T> {

    private int code;//状态妈
    private boolean sucsess;//是否成功
    private String msg;//提示信息
    private T data;//JSON数据

    public int getCode() {
        return code;
    }
    public boolean isSuccess() {
        return HttpConfig.HTTP_SUCCESS.equals(code);
    }

    public boolean isTokenInvalid() {
        return HttpConfig.HTTP_SIGN_OUT.equals(code);
    }

    public void setCode(int code) {
        this.code = code;
    }

    public boolean isSucsess() {
        return sucsess;
    }

    public void setSucsess(boolean sucsess) {
        this.sucsess = sucsess;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
